package com.yang.controller.admin;

import com.yang.bean.bj.vo.MarketExpressVO;
import com.yang.bean.bj.vo.MarketMallVO;
import com.yang.bean.bj.vo.MarketOrderVO;
import com.yang.bean.bj.vo.MarketWxVO;
import com.yang.bean.common.BaseRespVo;
import com.yang.service.adminimpl.ConfigServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @description: TOOD
 * @return:
 * @author: BaoZi
 * @date: 2022/9/7
 */
@RestController
@RequestMapping("admin/config")
public class AdminConfigController {

    @Autowired
    ConfigServiceImpl configService;

    /**
     * 配置管理->商场配置：mall
     * @return com.yang.bean.common.BaseRespVo
     * @author BaoZi
     * @since 2022/09/07 15:29
     */
    @RequestMapping("mall")
    public BaseRespVo mall(){
        MarketMallVO marketMallVO = configService.queryMarket();
        return BaseRespVo.ok(marketMallVO);
    }


    /**
     *  配置管理->运费配置：express
     * @return com.yang.bean.common.BaseRespVo
     * @author BaoZi
     * @since 2022/09/07 20:52
     */
    @RequestMapping("express")
    public BaseRespVo express(){
        MarketExpressVO marketExpressVO = configService.queryMarketExpress();
        return BaseRespVo.ok(marketExpressVO);
    }

    /**
     *  配置管理->订单配置：order
     * @return com.yang.bean.common.BaseRespVo
     * @author BaoZi
     * @since 2022/09/07 21:30
     */
    @RequestMapping("order")
    public BaseRespVo order(){
        MarketOrderVO marketOrderVO = configService.queryMarketOrder();
        return BaseRespVo.ok(marketOrderVO);
    }


    /**
     * 配置管理->小程序配置：wx
     * @return com.yang.bean.common.BaseRespVo
     * @author BaoZi
     * @since 2022/09/07 23:53
     */
    @RequestMapping("wx")
    public BaseRespVo wx(){
        MarketWxVO marketWxVO = configService.queryMarketWx();
        return BaseRespVo.ok(marketWxVO);
    }
}
